[root@jenkins bin]# cat /server/scripts/push_java.sh 
#!/bin/bash
mvn=$(/var/lib/jenkins/maven-3.8.6/bin/mvn)
groupId=$(mvn help:evaluate -Dexpression=project.groupId |egrep -v "[INFO]")
artifactId=$(mvn help:evaluate -Dexpression=project.artifactId |egrep -v "[INFO]")
version=$(mvn help:evaluate -Dexpression=project.version |egrep -v "[INFO]")
packaging=$(mvn help:evaluate -Dexpression=project.packaging |egrep -v "[INFO]")

mvn deploy:deploy-file \
    -DgroupId=${groupId} \
    -DartifactId=${artifactId} \
    -Dversion=${version} \
    -Dpackaging=${packaging} \
    -Dfile=target/${artifactId}-${version}.${packaging}  \
    -Durl=http://192.168.1.190:8081/repository/maven-releases/  \
    -DrepositoryId=nexus-releases \
    -DgeneratePom=true